﻿using System.Drawing;
using RRRSRoguelike.Entities.Creatures;
using RRRSRoguelikeData;

namespace RRRSRoguelike.Entities.Props
{
	/// <summary>
	/// Description of a weapon.
	/// Inherits <c>Tile</c>.
	/// </summary>
	public class Weapon : Tile
	{
		private int uses;
		private int maxUses;

		/// <summary>
		/// Constructor for sword. Contains hard code for 3 uses.
		/// </summary>
		/// <param name="position"></param>
		/// <param name="tileData"></param>
		public Weapon(Point position, TileData tileData)
			: base(position, tileData)
		{
			maxUses = 3;
		}

		public void Use(Player p)
		{
			uses++;

			if (uses >= maxUses)
				p.RemoveWeapon();
		}

		public int UsesRemaining
		{
			get { return maxUses - uses; }
		}
	}
}
